package IO;

import java.sql.Timestamp;
import java.util.Vector;

public class Log 
{
	private static int LOG_SIZE = 200;
	public static Vector<String> logs = new Vector<String>();
	public static void println(String logMessage)
	{
		Log.print(logMessage + "\n");
	}
	public static void print(String rawLogMessage)
	{
		java.util.Date date = new java.util.Date();
		String logMessage = new Timestamp(date.getTime())+" "+rawLogMessage;
		if(logs.size() > LOG_SIZE)
		{
			logs.remove(logs.size()-1);
		}
		logs.add(0, logMessage);
		System.out.print(logMessage);
	}
	public static void printErrorln(String errorMessage) 
	{
		Log.print("ERROR: "+errorMessage+"\n");
	}
}
